﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Customer_Profile.Admin
{
    public partial class UserGroupAdd : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void btnSave_ServerClick(object sender, EventArgs e)
        {
            string groupid = txtUserGroupId.Value;
            string groupname = txtUserGroupName.Value;
            string mark = txtDesc.Value;
            if (groupid == "" || groupname == "")
            {
                Response.Write("<script language=javascript>alert('Group Cannot Be Null !');</script>");
                return;
            }

            if (GroupDao.AddGroup(groupid, groupname, mark) == true)
            {
                Response.Write("<script language=javascript>alert('Add Succeed');</script>");
                txtUserGroupId.Value = "";
                txtUserGroupName.Value = "";
                txtDesc.Value = "";

                //记录用户操作日志
                //CVOC.Comm.WriteSystemLog(Session["SS_USER_ID"].ToString(), Utility.ReplaceChar(Utility.ReplaceQuote(Request["menu_idx"].ToString()), true), "02", Page.Request.UserHostAddress, Page.Request.Path, "用户组新增操作，用户组ID：" + txtUserGroupId.Value);

            }
            else
            {
                Response.Write("<script language=javascript>alert('Error!');</script>");
            }
        }

        protected void btnBack_ServerClick(object sender, EventArgs e)
        {
            Response.Redirect("UserGroupManage.aspx", true);
        }
    }
}
